-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support certificate role mappings #37269
Support certificate role mappings #37269
Conversation
...untime/src/main/java/io/quarkus/vertx/http/runtime/security/MtlsAuthenticationMechanism.java
Outdated
Show resolved
Hide resolved
350ff1b
to
0f7deec
Compare
I wanted to modify |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, few notes, two important, others you can ignore
...untime/src/main/java/io/quarkus/vertx/http/runtime/security/MtlsAuthenticationMechanism.java
Outdated
Show resolved
Hide resolved
...-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/security/HttpSecurityRecorder.java
Outdated
Show resolved
Hide resolved
...-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/security/HttpSecurityRecorder.java
Outdated
Show resolved
Hide resolved
...on-tests/mtls-certificates/src/test/java/io/quarkus/it/vertx/CertificateRoleMappingTest.java
Show resolved
Hide resolved
Thanks @michalvavrik, let me deal with the comments, all of them make sense |
0f7deec
to
c91f800
Compare
This comment has been minimized.
This comment has been minimized.
integration-tests/mtls-certificates/src/main/resources/application.properties
Show resolved
Hide resolved
...nsions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/AuthRuntimeConfig.java
Outdated
Show resolved
Hide resolved
I'm sure someone will come in the future asking to use a different certificate attribute :-), but CN seems good enough for a start. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, for what that's worth, except for one problem around loading the properties file.
(In case anyone is wondering: I reviewed this code mainly because I was curious having tinkered with this kind of thing a bit back in my days contributing to the WildFly Elytron project.)
...-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/security/HttpSecurityRecorder.java
Outdated
Show resolved
Hide resolved
...nsions/vertx-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/AuthRuntimeConfig.java
Outdated
Show resolved
Hide resolved
...-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/security/HttpSecurityRecorder.java
Outdated
Show resolved
Hide resolved
Thanks @dmlloyd, your feedback is very welcome |
f546eab
to
217511a
Compare
@dmlloyd Hi David, I think I've addressed your comments, which was easy since your typed how to address them :-), if there is anything else that you'd like to change, let me know please |
✔️ The latest workflow run for the pull request has completed successfully. It should be safe to merge provided you have a look at the other checks in the summary. |
Thanks @dmlloyd @michalvavrik and @Ladicek for the reviews. Let me merge and as always, things can be improved/optimized going forward |
@sberyozkin Just made aware of this. Why didn't you reuse the mechanism defined in https://datatracker.ietf.org/doc/html/rfc5755#section-4.4.5 instead of using a custom attribute (which lead to interoperability issue) |
At least it should be |
@cescoffier Sorry, I have missed it.
We don't expect here As far as expecting the certificate already have the roles, in the |
Shouldn't it use SAN and not the CN? Like for SNI. |
@cescoffier This PR addresses a specific requirement, use But sure, we can make the attribute name configurable, sounds good to me. |
Fixes #23683.
Tests to follow, also I thought I could avoid registering an augmentor and just pass the roles directly to the default X509 identity provider.
If these mappings are not comping from the file/classpath resource then a custom SecurityIdentityAugmentor will help.
I'll open for review later but early feedback is welcome